<template>
  <view>
    <view class="box">生命周期</view>

    <Banner />

    <view style="height: 2000px"></view>
  </view>
</template>

<script setup lang="ts">
import Banner from "@/components/banner/banner.vue";

// 导入页面级别的生命周期钩子函数
import {
  onLoad,
  onReady,
  onShow,
  onHide,
  onUnload,
  onPullDownRefresh,
  onReachBottom,
  onShareAppMessage,
} from "@dcloudio/uni-app";

onShareAppMessage(() => {
  return {
    title: "惊呆了",
    path: "/pages/index/index",
  };
});

onPullDownRefresh(() => {
  console.log("Page onPullDownRefresh");
});

onReachBottom(() => {
  console.log("Page onReachBottom");
});

onLoad((query) => {
  console.log("Page onLoad", query);
});

onReady(() => {
  console.log("Page onReady");
});

onShow(() => {
  console.log("Page onShow");
});

onHide(() => {
  console.log("Page onHide");
});

onUnload(() => {
  console.log("Page onUnload");
});
</script>

<style>
.box {
  height: 400rpx;
  background-color: green;
}
</style>
